#include<bits/stdc++.h>
using namespace std;
int n,x,a1,a2,ans;
int main()
{
	freopen("duel.in","r",stdin);
	freopen("duel.out","w",stdout);
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		cin>>x;
		if(x==1) a1++;
		else a2++;
	}
	if(a1>a2) ans=a1;
	else ans=a2;
	cout<<ans<<endl;
	return 0;
}
